package processor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.stereotype.Component;

/**
 * description: 扫描完成之后
 * 				parse , put map之前
 *
 * @author: lightyh
 * @date: 2020/8/17 23:54
 */
@Component
public class HhBeanPostProcess implements BeanFactoryPostProcessor {
	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		GenericBeanDefinition indexService = (GenericBeanDefinition) beanFactory.getBeanDefinition("indexService");
		indexService.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
		System.out.println(indexService.getAutowireMode());
	}
}